/**
 * Created by dukes on 2016/3/11.
 */
class GuildShopTab extends eui.Component{
    public constructor(){
        super();
        this.skinName = "skins.scene.elements.GuildShopTabSkin";
    }
    private _data:number
    public set data(value:number){
        this._data = value
    }
    public get data():number{
        return this._data
    }
    private state_0:eui.Image;
    private state_1:eui.Image;
    public partAdded(name:string, instance:any){
        super.partAdded(name, instance);
        if( name == "state_0"){
            this.state_0 = instance;
        }else if( name == "state_1"){
            this.state_1 = instance;
        }
    }

    public childrenCreated(){
        super.childrenCreated();
        if( this._data == 1){
            this.state_0.source = RES.getRes("img_fuck_guild_3");
            this.state_1.source = RES.getRes("img_fuck_guild_5");
        }else if( this._data == 2){
            this.state_0.source = RES.getRes("img_fuck_guild_23");
            this.state_1.source = RES.getRes("img_fuck_guild_1");
        }else if( this._data == 3){
            this.state_0.source = RES.getRes("img_fuck_guild_16");
            this.state_1.source = RES.getRes("img_fuck_guild_19");
        }
    }
}